video: When autoplaying, start playing once the video is prepared
authorBenjamin Otte <otte@redhat.com>
Wed, 16 Dec 2020 01:22:26 +0000 (02:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 24 Dec 2020 05:38:45 +0000 (06:38 +0100)
This fixe video sources with longer loading times not automatically
playing.

gtk/gtkvideo.c

index 9f3eb43d94449f9cbb320334d5857a1f2a3aef67..d2cb23321ab5f80f695426aa6227434e86859ee2 100644 (file)
@@ -545,6 +545,11 @@ gtk_video_notify_cb (GtkMediaStream *stream,
     gtk_video_update_error (self);
   if (g_str_equal (pspec->name, "playing"))
     gtk_video_update_playing (self);
+  if (g_str_equal (pspec->name, "prepared"))
+    {
+      if (self->autoplay && gtk_media_stream_is_prepared (stream))
+        gtk_media_stream_play (stream);
+    }
 }
 
 /**